<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <style>
      .box {
        width: 100px;
        height: 200px;
        background: red;
        padding: 10px;
        margin: 20px;
        border: 5px solid;
      }
      /* .container {
        width: 300px;
        height: 300px;
        border: 1px solid red;
        margin-left: 50px;
        position: relative;
      }
      .box {
        width: 100px;
        height: 100px;
        border: 1px solid;
        position: absolute;
        left: 100px;
      }
      .mydiv {
        width: 100px;
        height: 100px;
        border: 10px solid;
      } */
      /* .a {
        width: 100px;
        height: 2000px;
        background: red; 
      }*/
    </style>
    <div class="container">
      <div class="box"></div>
    </div>
    <div class="a"></div>
    <div class="mydiv"></div>
  </body>
  <script>
    var boxEle = document.querySelector(".box");
    // document.onclick = function () {
    //   console.log(boxEle.offsetWidth);
    //   console.log(boxEle.offsetHeight);
    // };
  </script>
</html>
